// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "shell/browser/notifications/notification.h"
#include "ohos/adapter/notification/notification_adapter.h"

#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_OHOS_OHOS_NOTIFICATION_H_
#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_OHOS_OHOS_NOTIFICATION_H_

namespace electron {

class OhosNotification : public Notification {
 public:
  OhosNotification(NotificationDelegate* delegate,
                   NotificationPresenter* presenter);
  ~OhosNotification() override;
  
  static bool Initialize();
  // Notification:
  void Show(const NotificationOptions& options) override;
  void Dismiss() override;

 private:
  void ConvertOptionsToNotificationRequest(const NotificationOptions& options, 
                                           ohos::adapter::NotificationRequest& request);
  void RegisterCallbacks();
  inline static int32_t next_id_{};
  int32_t current_id_{};
  int64_t timestamp_{};
  base::WeakPtrFactory<OhosNotification> weak_factory_{this};
};

}  // namespace electron

#endif  // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_OHOS_OHOS_NOTIFICATION_H_
